package com.words.service.Impl;

import com.words.dao.WordDao;
import com.words.entity.Cet6Words;
import com.words.service.WordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WordServiceImpl implements WordService {

    @Autowired
    WordDao wordDao;


    @Override
    public List<Cet6Words> findAll() {
        return wordDao.findAll();
    }

    @Override
    public List<Cet6Words> queryByWord(String word) {
        return wordDao.findByWord(word);
    }

    @Override
    public void addNote(int id, String note) {
//        System.out.println(id);
        System.out.println(note);
        wordDao.addNote(id,note);
    }

    @Override
    public void deleteNote(int id) {
        wordDao.deleteNote(id);
    }
}
